#ifndef _INCLUDED_DATATYPE_H_
#define _INCLUDED_DATATYPE_H_

#include <wx/string.h>
#include <memory.h>

#define		INCALID_CHAR_INDEX				(-1U)

class WTextDumpData
{
	private:
		wchar_t*		m_pArray;
		size_t			m_sSize;

		void			_initizlie(void);
		wchar_t*        _heapArray(size_t sSize);
		void			_releaseArray(wchar_t* pSource);
		void			_setArrayData(const wchar_t* pSource, size_t sSize);
		void			_resizeArray(size_t sNewSize, bool bKeepData = true);
	public:
						WTextDumpData(void);
						WTextDumpData(wchar_t* pArray, size_t sSize);
						WTextDumpData(const WTextDumpData& clsObject);
						~WTextDumpData(void);
		wchar_t*		Array(void) const;
		size_t			Size(void) const;
		void			Set(const wchar_t* pSource, size_t sSize);
		size_t			IndexOf(wchar_t cCode);
		void			RemoveDuplicate(void);
		void			Sort(void);
		wxString		ToString(void) const;
		wchar_t			GetChar(size_t sIndex);
};

class DumpTextData
{
	private:
		WTextDumpData*	m_pclsHalfWidthCharArray;
		WTextDumpData*	m_pclsFullWidthCharArray;
		WTextDumpData*	m_pclsCharArray;
		size_t			m_sSize;

		void			_initialize(void);
		void			_sort(void);
		wxString		_getIndexEncode(size_t sIndex);
	public:
						DumpTextData(void);
						DumpTextData(const wxString& strText);
						~DumpTextData(void);
		void			SetString(const wxString& strText);
		void			GetAllCharacter(wxString& strOut);
		wxString		GetAllCharacter(void);
		void			GetHalfWidthCharacter(wxString& strOut);
		wxString		GetHalfWidthCharacter(void);
		void			GetFullWidthCharacter(wxString& strOut);
		wxString		GetFullWidthCharacter(void);

		wchar_t			GetChar(size_t sIndex);
		size_t			GetIndex(wchar_t cCharCode);
		size_t			GetHalfCharIndex(wchar_t cCharCode, size_t sStartIndex = 0);
		size_t			GetFullCharIndex(wchar_t cCharCode, size_t sStartIndex = 0);
		wxString		GetTextEncode(const wxString& strText, bool bUseFullASCII = false);
};

#endif // _INCLUDED_DATATYPE_H_
